package com.nana.framework.ui.manager.base
{
	import flash.utils.Dictionary;

	// 实例化tooltip
	public class ToolTipPool {
		
		private static var toolTipDic:Dictionary = new Dictionary();
		
		public static function getToolTip(toolTipClass:Class):IToolTip{
			if (toolTipDic[toolTipClass] == null){
				toolTipDic[toolTipClass] = new Vector.<IToolTip>();
			}
			var vec:Vector.<IToolTip> = toolTipDic[toolTipClass];
			for(var i:int = 0; i < vec.length; i++) {
				if(vec[i].invalid == true) {
					vec[i].invalid = false;
					return vec[i];
				}
			}
			var tooltip:IToolTip = new (toolTipClass)() as IToolTip;
			vec.push(tooltip);
			return tooltip;
		}
		
	}
}